#!/bin/sh
##########################################################################
# This file is part of Hawkengine.
#
# Hawkengine is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Hawkengine is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with Hawkengine.  If not, see <http://www.gnu.org/licenses/>.
##########################################################################

if [ $WEBOS_TYPE = "native" ]; then
  WEBOS_APP_TYPE=pdk
  WEBOS_PACKAGE_PROPERTIES=$WEBOS_PROJECT_DIR/$WEBOS_APP/package.properties
  echo "filemode.755 = $WEBOS_APP" > $WEBOS_PACKAGE_PROPERTIES
else
  WEBOS_APP_TYPE=web
fi

WEBOS_APPINFO_JSON=$WEBOS_PROJECT_DIR/$WEBOS_APP/appinfo.json
echo "{" > $WEBOS_APPINFO_JSON
echo "  \"id\": \"$WEBOS_PACKAGE\"," >> $WEBOS_APPINFO_JSON
echo "  \"version\": \"$WEBOS_VERSION\"," >> $WEBOS_APPINFO_JSON
echo "  \"vendor\": \"Hawkorn LLC\"," >> $WEBOS_APPINFO_JSON
echo "  \"type\": \"$WEBOS_APP_TYPE\"," >> $WEBOS_APPINFO_JSON
echo "  \"main\": \"$WEBOS_APP\"," >> $WEBOS_APPINFO_JSON
echo "  \"title\": \"$WEBOS_APP_TITLE\"," >> $WEBOS_APPINFO_JSON
echo "  \"icon\": \"icon.png\"," >> $WEBOS_APPINFO_JSON
echo "  \"requiredMemory\": 48" >> $WEBOS_APPINFO_JSON
echo "}" >> $WEBOS_APPINFO_JSON

echo
echo Webos preparation for $WEBOS_APP complete.
echo
